<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item of slides" :key="item.goodsId">
      <router-link :to="{path:'/details',query:{id:item.goodsId}}">
        <van-image :src="$filterImage(item.image)" lazy-load>
          <template v-slot:loading>
            <van-loading type="spinner" size="20" />
          </template>
        </van-image>
      </router-link>
    </van-swipe-item>
  </van-swipe>
</template>

<script>
//vuex方法
//import {createNamespacedHelpers} from "vuex"
//const {mapState} = createNamespacedHelpers("homeModule")

export default {
  /*props: {
    datas: {
      type: Object,
      required: true
    }
  },*/
  data() {
    return {
      slides: []
    };
  },
  /*computer:{       //vuex方法
        ...mapState(["datas"])
    },*/
  method: {},
  /*watch: {
    datas: {
      handler(datas) {
        this.slides = datas.slides;
      }
    }
  },*/
  created() {
    this.$eventBus.$on("getIndexInfo", res => {
      this.slides = res.slides;
    });
  }
};
</script>

<style>
</style>